package com.ruoyi.common.base.service.impl;

import com.ruoyi.common.base.domain.BaseMapper;
import com.ruoyi.common.base.service.BaseService;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.List;

/**
 * @author cx
 * @date 2023/6/8
 * @apiNote
 */
public abstract class BaseServiceImpl<T> implements BaseService<T> {
    protected abstract BaseMapper<T> getEntityMapper();

    @Override
    public T selectById(Serializable id) {
        return getEntityMapper().selectById(id);
    }

    @Override
    public List<T>  selectByIds(Serializable ids) {
        return  getEntityMapper().selectByIds(ids);
    }

    @Override
    public List<T> selectList(T t) {
        return getEntityMapper().selectList(t);
    }

    @Override
    public int insert(T t) {

        return getEntityMapper().insert(t);
    }
    @Override
    public int delete(Serializable id) {
        return   getEntityMapper().delete(id);
    }
    @Override
    public int update(T t) {
        return getEntityMapper().update(t);
    }


    @Override
    public int deleteByIds(String[] ids) {
        return getEntityMapper().deleteByIds(ids);
    }

    @Override
    public int deleteByIds(Long[] ids) {
        return getEntityMapper().deleteByIds(ids);
    }

}
